<template>
    <div class="not-found">
        <h1 class="error-code">404</h1>
        <p class="error-desc">抱歉，您访问的页面不存在</p>
        <t-button type="primary" round @click="goHome">
            返回首页
        </t-button>
    </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
import { useUserStore } from '@/store'

const userStore = useUserStore()
const router = useRouter()
const role = userStore.role

const goHome = () => {
    if (role === 'admin') {
        router.push('/admin')
    }
    if (role == 'user') {
        router.push('/user')
    }
}
</script>

<style scoped>
.not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
}

.error-code {
    font-size: 150px;
    background: linear-gradient(120deg, #409EFF, #67C23A);
    background-clip: text;
    color: transparent;
    margin: 0 0 80px 0;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.error-desc {
    font-size: 24px;
    color: #606266;
    margin: 0 0 40px 0;
    letter-spacing: 1px;
    font-weight: 500;
}

:deep(.el-button) {
    padding: 12px 30px;
    font-size: 16px;
    transition: transform 0.3s ease;
}

:deep(.el-button:hover) {
    transform: scale(1.05);
}
</style>
